<template>
  <div>
    <h1>B模块的名字{{ name }}</h1>
    <button @click="f">改B的名字</button>
  </div>
</template>
<script>
// @ is an alias to /src
export default {
  name: 'XXX',
  methods: {
    f() {
      this.$store.commit('myB/changeName', "小工B")
    }
  },
  computed: {
    name() {
      return this.$store.state.myB.name
    }
  }
}
</script>
<style lang="less">
</style>